package com.lmjssjj.gifwallpaper;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.graphics.ImageDecoder;
import android.graphics.drawable.AnimatedImageDrawable;
import android.os.Build;
import android.os.Bundle;
import android.view.View;

import java.io.IOException;

public class MainActivity extends AppCompatActivity {

    @RequiresApi(api = Build.VERSION_CODES.P)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

//        try {
//            @SuppressLint("WrongThread")
//            AnimatedImageDrawable drawable = (AnimatedImageDrawable) ImageDecoder.decodeDrawable(ImageDecoder.createSource(getAssets(), ""));
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

    }

    public void set(View view) {
        GIFWallpaperService.setToWallPaper(this);
    }
}
